Skip to content

Conversation

@snomiao
Copy link
Member

@snomiao snomiao commented Aug 9, 2025

Summary

Implements the admin tags dashboard as requested in issue #57. The system has been migrated from categories to tags, allowing nodes to have multiple tags instead of a single category.

Changes Made

  • Added Tag Management link to AdminTreeNavigation
  • Created comprehensive admin tags dashboard at /admin/tags
  • Displays all node tags with their respective node counts
  • Migrated from category system to tags system (with fallback support for legacy category field)
  • Added proper breadcrumb navigation and admin layout
  • Updated admin index page to include tag management quick action
  • Integrated seamlessly with existing admin dashboard structure

Features

  • Shows tags view of all nodes with counts
  • Supports multiple tags per node (primary improvement over categories)
  • Fallback to legacy category field for backwards compatibility
  • Sortable by node count (highest first)
  • Responsive layout with proper admin navigation
  • Handles empty states gracefully
  • Uses existing design patterns and components

Test plan

  • Verify admin authentication is required
  • Check tags dashboard loads correctly at /admin/tags
  • Confirm tags display with accurate node counts
  • Test navigation between admin sections works properly
  • Validate responsive design on different screen sizes
  • Verify nodes with multiple tags are counted correctly

🤖 Generated with Claude Code

snomiao and others added 2 commits May 7, 2025 16:54
- Add Category Management to AdminTreeNavigation
- Create comprehensive category dashboard at /admin/category
- Display node categories with counts in organized layout
- Add breadcrumb navigation and proper admin layout
- Integrate with existing admin dashboard structure

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copilot AI review requested due to automatic review settings August 9, 2025 10:42
@snomiao snomiao linked an issue Aug 9, 2025 that may be closed by this pull request
3 tasks
@vercel
Copy link

vercel bot commented Aug 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
registry-web Error Error Oct 26, 2025 8:19am

This comment was marked as outdated.

@github-actions
Copy link

github-actions bot commented Aug 9, 2025

🎨 Chromatic Visual Testing Results

Resource URL
🔍 Build Results Chromatic Build
📚 Storybook View Storybook

Check the visual changes and approve or request changes as needed.

… pagination

- Renamed admin category page from category.tsx to categories.tsx for consistency
- Implemented server-side pagination using useListAllNodes with page/limit parameters
- Updated navigation links in AdminTreeNavigation and admin index page
- Added CustomPagination component with URL state management
- Removed client-side pagination in favor of API-level pagination

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link

🎨 Chromatic Visual Testing Results

Resource URL
🔍 Build Results Chromatic Build
📚 Storybook View Storybook

Check the visual changes and approve or request changes as needed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements an admin category dashboard that allows administrators to view and manage node categories. The feature adds a new admin page at /admin/categories that displays all node categories with their respective node counts in a sortable format.

Key Changes

  • Added Category Management navigation link and quick action button in the admin interface
  • Created a comprehensive category dashboard displaying node categories with counts
  • Added internationalization support for the new feature across multiple languages

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

File Description
pages/admin/index.tsx Added Category Management quick action button to admin dashboard
pages/admin/categories.tsx Created new category management page with node category overview
components/admin/AdminTreeNavigation.tsx Added Category Management link to admin navigation tree
locales/*/common.json Added translations for category management features across all supported languages

.sort((a, b) => b.count - a.count)
}, [nodesData?.nodes])

const totalPages = Math.ceil((nodesData?.total || 0) / limit)
Copy link

Copilot AI Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pagination logic is incorrect. The totalPages calculation is based on total nodes, but the displayed data is categories. This will show incorrect pagination when the number of categories differs from the number of nodes.

Copilot uses AI. Check for mistakes.
Replace manual URL query handling with reusable usePage hook for cleaner pagination management.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link

🎨 Chromatic Visual Testing Results

Resource URL
🔍 Build Results Chromatic Build
📚 Storybook View Storybook

Check the visual changes and approve or request changes as needed.

@snomiao snomiao marked this pull request as draft August 12, 2025 11:47
- Updated orval-generated API client with latest tag system
- Renamed categories.tsx to tags.tsx to reflect new tag-based approach
- Modified admin dashboard to display and manage tags instead of categories
- Updated navigation links and labels throughout admin panel
- Maintained backwards compatibility by falling back to category field when tags are unavailable

The tag system provides more flexible classification with multiple tags per node compared to single category assignment.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Add useCallback to wrap verifyRepoPermissions function
- Include all missing dependencies in useEffect dependency array
- Applied Prettier formatting for consistency

🤖 Generated with Claude Code (https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Resolved merge conflicts in:
- Locale files (en, es, fr, ja, ko, ru, zh)
- claim-my-node.tsx (removed duplicate imports)
- generated.ts (regenerated using orval)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@snomiao snomiao changed the title feat: implement admin category dashboard feat: implement admin tags dashboard Oct 16, 2025
Previously, the /admin/tags page was showing a summary of tag counts
including "Uncategorized" entries. This was confusing and not helpful.

Now the page displays a proper table showing all nodes with their
associated tags. Nodes without tags display "No tags" text instead
of an "Uncategorized" badge.

Changes:
- Replaced tag summary cards with a proper table layout
- Added Table component from flowbite-react
- Show node names with their tags in separate columns
- Display "No tags" text for nodes without tags
- Removed aggregation logic that was creating "Uncategorized" entries

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Use the adminUpdateNode endpoint when editing tags_admin field to ensure proper admin privileges. Falls back to regular updateNode endpoint when only regular tags are modified.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@snomiao
Copy link
Member Author

snomiao commented Oct 25, 2025

Admin endpoint is already being used correctly

The tag management page already uses the admin update endpoint when admin_tags are modified:

Code in pages/admin/tags.tsx:119-130:

// If admin tags changed, use admin endpoint
if (adminTagsChanged) {
    const updatedNode: Node = {
        ...editingNode,
        tags: newTags,
        tags_admin: newAdminTags,
    }

    await adminUpdateNodeMutation.mutateAsync({
        nodeId: editingNode.id!,
        data: updatedNode,
    })
}

The logic correctly detects when admin_tags change (line 109-111) and routes to the admin endpoint, while regular tag-only changes use the publisher endpoint (line 133-151).

@snomiao
Copy link
Member Author

snomiao commented Oct 25, 2025

lets allow publisher edit their node's tags in node details page

{t('Nodes with Tags')}
</h2>
<Badge color="info" icon={HiOutlineCollection}>
{nodesData?.total || 0} {t('nodes')}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"1535 nodes"

this should use white text

<Table.Cell className="whitespace-nowrap font-medium text-gray-200">
<div className="flex items-center space-x-2">
<HiOutlineCollection className="h-4 w-4 text-blue-400" />
<div>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a open in new window button beside, go to node details page when click

@snomiao snomiao marked this pull request as ready for review October 25, 2025 13:35
Allow publishers to edit their node's tags from the node details page via the Edit modal. This gives publishers more control over how their nodes are categorized and discovered.

Changes:
- Add tags field to NodeEditModal for editing
- Display current tags on node details page with Badge components
- Parse and save tags as comma-separated values
- Add helper text explaining tag usage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@snomiao
Copy link
Member Author

snomiao commented Oct 25, 2025

Publishers can now edit tags from node details page

Implemented tag editing for publishers in the node details page as requested. Publishers can now:

  1. View tags: Tags are displayed on the node details page with purple badges
  2. Edit tags: The "Edit details" modal now includes a tags field
  3. Save tags: Tags are saved as comma-separated values using the publisher update endpoint

Changes in this commit (5bb25aa):

  • Added tags input field to NodeEditModal component
  • Display current tags on node details page with Badge components
  • Parse and save tags array from comma-separated input
  • Added helper text explaining tag usage

All CI/CD checks passing ✅

Changed the tag management page to consistently use the admin update endpoint for all tag modifications, regardless of whether admin_tags or regular tags are changed. This simplifies the logic and ensures admin privileges are used throughout the admin interface.

Changes:
- Removed conditional endpoint selection logic
- Removed unused useUpdateNode hook and publisher ID checks
- Always use adminUpdateNode for all tag updates
- Added early return for no-change scenarios

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Resolved merge conflicts by keeping current branch changes:
- Preserved tag management functionality in AdminTreeNavigation
- Kept tags display in NodeDetails component
- Maintained tags input in NodeEditModal
- Updated all locale files with new tag-related translations
- Retained admin dashboard tag management link

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat req: admin category dashboard /admin/category/

2 participants